require('joose');

Class('Point', {
    has: {
        x: { is: 'rw', required: true },
        y: { is: 'rw', required: true }
    },


    methods: {
        clear: function ()
        {
            this.setX(0)
            this.setY(0)
        }
    }

})

Class('Point3D', {
    isa: Point,

    has: {
        z: { is: 'rw', required: true }
    },


    after: {
        clear: function ()
        {
            this.setZ(0)
        }
    }

})

var point1 = new Point({ x: 5, y: 7 })
var point3d = new Point3D({ x: 5, y: 7, z: -5 })

point3d.clear();

///-----------
Class('Point4D', {
    isa: Point3D,

    has: {
        w: { is: 'rw' }
    },

    methods: {
        clear: function ()
        {
            this.SUPER();
            this.setW(0);
        }
    }
})

var pt4 = new Point4D({ x: 5, y: 7, z: -5, w:7, t:9 });
pt4.clear();

pt4.x = 3;



